import request from '@/config/axios'

// 存货分类 VO
export interface InventoryClassifyVO {
  id: number // 分类id
  code: string // 分类编码
  name: string // 分类名称
  parentId: number // 父分类id
}

// 存货分类 API
export const InventoryClassifyApi = {
  // 查询存货分类分页
  getInventoryClassifyPage: async (params: any) => {
    return await request.get({ url: `/wms/inventory-classify/page`, params })
  },

  // 查询存货分类简单列表
  getInventoryClassifySimpleList: async () => {
    return await request.get({ url: `/wms/inventory-classify/simple-list` })
  },

  // 查询存货分类详情
  getInventoryClassify: async (id: number) => {
    return await request.get({ url: `/wms/inventory-classify/get?id=` + id })
  },

  // 新增存货分类
  createInventoryClassify: async (data: InventoryClassifyVO) => {
    return await request.post({ url: `/wms/inventory-classify/create`, data })
  },

  // 修改存货分类
  updateInventoryClassify: async (data: InventoryClassifyVO) => {
    return await request.put({ url: `/wms/inventory-classify/update`, data })
  },

  // 删除存货分类
  deleteInventoryClassify: async (id: number) => {
    return await request.delete({ url: `/wms/inventory-classify/delete?id=` + id })
  },

  // 导出存货分类 Excel
  exportInventoryClassify: async (params) => {
    return await request.download({ url: `/wms/inventory-classify/export-excel`, params })
  },
}
